Skip to content

fix(slider): handle scientific notation in getDecimalCount for steps …#3853

Open
nilesh65 wants to merge 1 commit intoradix-ui:mainfrom
nilesh65:fix/slider-small-step-scientific-notation
Open

fix(slider): handle scientific notation in getDecimalCount for steps …#3853
nilesh65 wants to merge 1 commit intoradix-ui:mainfrom
nilesh65:fix/slider-small-step-scientific-notation

Conversation

@nilesh65
Copy link
Copy Markdown

fix(slider): handle precision for values <= 1e-7

Fixes #3852

Description

Fixes an issue where Slider precision breaks for values <= 1e-7 due to improper handling of scientific notation in decimal count calculation.

The previous implementation of getDecimalCount did not correctly handle scientific notation values, leading to incorrect slider step precision calculation.

This update ensures:

  • Proper handling of scientific notation (e.g. 1e-7)
  • Correct decimal precision calculation for slider steps
  • No change in public API or component behavior

This is a non-breaking internal fix with no changes to public API.

Testing

  • Verified manually in Storybook with step values <= 1e-7
  • Ensured no regression in slider dragging behavior
  • All existing tests pass (pnpm test)
image

Notes

  • No additional tests added as existing slider behavior tests already cover precision handling paths.
  • No Storybook changes required as UI behavior remains unchanged.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2026

⚠️ No Changeset found

Latest commit: 447acda

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Slider] Slider doesn't work when step is <= 1e-7

2 participants